#!/usr/bin/env python
PACKAGE = "tuw_multi_robot_router"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("voronoi_graph",              bool_t,    0,  "Defines if the generated Graph is a voronoi one (in doubt use false)", True)
gen.add("priority_rescheduling",      bool_t,    0,  "Defines if priority rescheduling is used", True)
gen.add("speed_rescheduling",         bool_t,    0,  "Defines if speed rescheduling is used", True)
gen.add("router_time_limit_s",        double_t,  0,  "Sets the upper limit for a planning approach. (router time is not overall time)", 10, 0.1, 300);
gen.add("topic_timeout_s",            double_t,  0,  "Sets the timeout for deleting latched topics", 10, 0.1, 300);
gen.add("path_endpoint_optimization", bool_t,    0,  "optimizes the path (only possible for 1 robot)", False);
collision_resolver_type =   gen.enum([  gen.const("None",           int_t, 0, "No collision Resolver (Standard A-Star)"),
                                        gen.const("Backtracking",   int_t, 1, "Backtracking (includes wait steps)"),
                                        gen.const("Avoidance",      int_t, 2, "Avoidance (includes wait steps and can avoid other robots in crossings)")],
                                        "Collision resolver type")

gen.add("collision_resolver", int_t, 0, "The used collision resolver for the multi robot planner", 2, 0, 2, edit_method=collision_resolver_type)

goal_mode_en = gen.enum([  gen.const("use_map_goal",       int_t, 0, "endpoint is maped to the real endpoint"),
                           gen.const("use_voronoi_goal",   int_t, 1, "endpoint is mapped to the end point on the segment"),
                           gen.const("use_segment_goal",   int_t, 2, "endpoint is mapped to the corresponding segment endpoint")],
                           "Collision resolver type")

gen.add("goal_mode", int_t, 0, "The endpoint mode", 1, 0, 2, edit_method=goal_mode_en)

multi_robot_router = gen.enum([  gen.const("standard_rotuer",       int_t, 0, "standard single threaded router"),
                                 gen.const("threaded_rotuer_srr",   int_t, 1, "multithreaded robot router")],
                                 "Multi_robot_router_type")

gen.add("router_type", int_t, 0, "Router Type", 0, 0, 1, edit_method=multi_robot_router)

gen.add("nr_threads",                 int_t,     0,  "sets the number of threads for the selected router", 1, 1, 64);


exit(gen.generate(PACKAGE, "tuw_multi_robot_router", "router"))
 
